package org.example.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;
@Data
public class User {
    @Schema(description = "用户的Id")
    private Long id;
    private String username;
    //当 Jackson 将 Java 对象转换为 JSON 字符串时，被 @JsonIgnore 注解的字段或方法不会出现在生成的 JSON 数据中
    @JsonIgnore
    private String password;

    private String nickname;

    private String phoneNum;

    private String email;

    private Byte gender;
    @JsonIgnore
    private String salt;

    private String avatarUrl;

    private Integer articleCount;

    private Byte isAdmin;

    private String remark;

    private Byte state;
    @JsonIgnore
    private Byte deleteState;

    private Date createTime;

    private Date updateTime;

//    public String getUsername() {

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", phoneNum='" + phoneNum + '\'' +
                ", email='" + email + '\'' +
                ", gender=" + gender +
                ", salt='" + salt + '\'' +
                ", avatarUrl='" + avatarUrl + '\'' +
                ", articleCount=" + articleCount +
                ", isAdmin=" + isAdmin +
                ", remark='" + remark + '\'' +
                ", state=" + state +
                ", deleteState=" + deleteState +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }


//        return username;
//    }
}